#ifndef FPSCOUNTER_H
#define FPSCOUNTER_H

class FPSCounter
{
    public:
        FPSCounter();
        virtual ~FPSCounter();
        void clear_surface();
        bool init();
        bool delayFrame();
        bool updateFPS();
        void toggleFps();
        bool isShown()              {return shown;}
        bool getMovingUp()          {return movingUp;}
        int getFrame()              {return frame;}

        SDL_Surface* getFpsCounter(){return fpsCounter;}

        static std::unique_ptr<FPSCounter> sInstance;
        Timer update;
        Timer elapsed;
    protected:

    private:
        bool cap;
        bool shown;
        bool movingUp;
        const int FRAMES_PER_SECOND = 30;
        int frame;

        SDL_Surface* fpsCounter;

        Timer fps;
};

#endif // FPSCOUNTER_H
